import axios from 'axios';
// let base = 'http://paiqi.xiegangsir.com/api';
let base = '/api';
//别名命名规则：模块+操作，常用操作：list(列表),info(详情),update(更新),destroy(删除),active(激活/启用),forbid(锁定/禁用)
//组件命名规则：一个导航一个目录，导航下的子菜单一个菜单一个文件
//系统登陆
export const UserLogin = params => { return axios.post(`${base}/login`, params).then(res => res.data); };//登录
export const UserLogout = params => { return axios.get(`${base}/logout`, params).then(res => res.data); };//退出登录
export const Captcha = params => { return axios.get(`${base}/captcha`, params).then(res => res.data); };//验证码
//用户管理部分
export const UserList = params => { return axios.get(`${base}/user`, params).then(res => res.data); };//用户列表
export const UserDestory = params => { return axios.delete(`${base}/user/destroy`, params).then(res => res.data); };//用户删除
export const UserUpdate = params => { return axios.post(`${base}/user/update`, params).then(res => res.data); };//用户更新
export const UserInfo = params => { return axios.get(`${base}/user/info`, params).then(res => res.data); };//用户基本信息
export const UserAll = params => { return axios.get(`${base}/user/all`, params).then(res => res.data); };//用户基本信息
//广告部分
export const AdList = params => { return axios.get(`${base}/ad`, params).then(res => res.data); };//广告列表
export const AdDestory = params => { return axios.delete(`${base}/ad/destroy`, params).then(res => res.data); };//广告删除
export const AdUpdate = params => { return axios.post(`${base}/ad/update`, params).then(res => res.data); };//广告更新
export const AdStore = params => { return axios.post(`${base}/ad/store`, params).then(res => res.data); };//广告更新
